package com.example.administrator.myapplication.activity;

import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.MediaController;
import android.widget.VideoView;

import com.example.administrator.myapplication.R;

public class Course_videoActivity extends AppCompatActivity {
VideoView courseVideo;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_course_video);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
         courseVideo=(VideoView) findViewById(R.id.course_video);
        String videourl=getIntent().getStringExtra("video");
        courseVideo.setVideoURI(Uri.parse(videourl));
        MediaController controller=new MediaController(this);
        courseVideo.setMediaController(controller);
      courseVideo.start();
    }
}
